package com.ag.lwc.action;

import java.util.List;
import java.util.Set;

import com.ag.bean.TbPropose;
import com.ag.bean.TbProposeRecord;
import com.ag.common.BaseAction;
import com.ag.common.EventUtil;
import com.ag.lwc.service.EventProposeService;

/**
 * 返回事件的成批和成批记录
 * 
 * @author user
 * 
 */
public class EventProposeAction extends BaseAction {

	private static final long serialVersionUID = -5530110334727186817L;
	private String eventId; // 事件
	private TbPropose propose; // 成批
	private Set<TbProposeRecord> records; // 成批记录
	private EventProposeService proposeService;
	private String message;

	/**
	 * 查询成批和成批的记录
	 * 
	 * @return
	 */
	public String findProposeAndRecords() {
		try {
			eventId = (String) getSession().getAttribute(
					EventUtil.PROCESSING_EVENT_ID);
			// System.out.println("EventProposeAction : 当前事件id："+eventId);
			propose = proposeService.findByEvent(eventId);
			if (propose != null) {
				//records = proposeService.findProposeRecord(propose.getPpId());
				records = propose.getTbProposeRecords();
			}

		} catch (Exception e) {

			e.printStackTrace();
		}
		return "find";
	}

	public String getEventId() {
		return eventId;
	}

	public void setEventId(String eventId) {
		this.eventId = eventId;
	}

	public TbPropose getPropose() {
		return propose;
	}

	public void setPropose(TbPropose propose) {
		this.propose = propose;
	}


	public Set<TbProposeRecord> getRecords() {
		return records;
	}

	public void setRecords(Set<TbProposeRecord> records) {
		this.records = records;
	}

	public EventProposeService getProposeService() {
		return proposeService;
	}

	public void setProposeService(EventProposeService proposeService) {
		this.proposeService = proposeService;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
